Field of the Invention
The present invention relates to an image processing apparatus and an image processing method, and more particularly to a technique using coding of a moving image.
Description of the Related Art
Conventionally, there has been used a certain technique when editing a moving image, for example, splitting or merging it. In the technique, a moving image for editing (hereinafter referred to as an editing moving image) having a smaller size than the moving image to be edited is prepared, an editing point is determined by using the editing moving image, and then the moving image to be edited is edited based on the editing point (for example, refer to Japanese Patent Application Laid-Open No. 2003-61041). The editing moving image is also referred to as a proxy.
As a method for coding a moving image and compressing the amount of information, the H.264 coding method is known. With such a coding method, it is necessary to set a virtual buffer, and control a code amount so that the occupancy of coded data to be stored in the virtual buffer falls within a predetermined range.
When generating a proxy, an original moving image to be edited is once decoded, processing for reducing the screen size is performed on the moving image, and then compression and coding processing is again performed thereon. Thus, this procedure takes much time for generating a proxy. Accordingly, a method is conceivable, in which an editing moving image having a small number of pixels is generated and recorded while recording a high-definition main moving image.
When simultaneously recording a main moving image and an editing moving image as described above, the main moving image requires a larger data amount and a higher data rate for moving image data to be recorded than the editing moving image does. Therefore, although the virtual buffer of the editing moving image neither overflows nor underflows, the virtual buffer of the main moving image may overflow or underflow.
In this case, the main moving image is not properly coded. Accordingly, processing for replacing a frame in which the virtual buffer has overflowed or underflowed with the previous frame is performed, for example. Therefore, the main moving image may include an image different from that of the editing moving image for the frame in which the virtual buffer has failed.
The moving image data of the main moving image requires a high data rate. Therefore, when the data rate is controlled according to an upper-limit rate for recording or transmission, coding deterioration may be conspicuous in the main moving image although it is not conspicuous in the editing moving image.
In this case, the main moving image is not properly coded, and an image in a frame of the main moving image differs from an image in the corresponding frame of the editing moving image.
As described above, there has conventionally been a problem that, when the main moving image is not properly coded, a user cannot recognize that an image in a frame of the main moving image differs from an image in the corresponding frame of the editing moving image.